package com.example.register_demo.home

import android.content.Intent
import android.os.Bundle
import androidx.fragment.app.Fragment
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.cardview.widget.CardView
import com.example.remindme.ChartActivity

import com.example.remindme.R
import com.example.remindme.RemindActivity

class HomeFragment : Fragment() {

    lateinit var remindCard:CardView
    lateinit var timeCardView: CardView
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)

    }

    override fun onCreateView(
        inflater: LayoutInflater, container: ViewGroup?,
        savedInstanceState: Bundle?
    ): View? {
        // Inflate the layout for this fragment
        return inflater.inflate(R.layout.fragment_home, container, false)
    }

    override fun onActivityCreated(savedInstanceState: Bundle?) {
        super.onActivityCreated(savedInstanceState)
       remindCard= requireView().findViewById(R.id.remindCard)
        timeCardView=requireView().findViewById(R.id.timeCard)

        remindCard.setOnClickListener{
// todo go to the chart activity
            val intent=Intent(requireActivity(),RemindActivity::class.java)
            startActivity(intent)
        }
        // 跳转到新开的intent对应的activity
        timeCardView.setOnClickListener{
            val intent=Intent(requireActivity(), ChartActivity::class.java)
            startActivity(intent)
        }
    }


}